package com.ibeeking.found.file.service.common.param;

import com.ibeeking.found.file.service.common.constants.RegexConstant;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author ibeeking
 * @version 1.0
 * @description: 用户注册DTO
 * @date 2022/1/12 14:41
 */
@Data
public class RegisterParam implements Serializable {
    private static final long serialVersionUID = -1L;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    @Size(min = 1, max = 20, message = "用户名最少1位，最多20位")
    private String username;

    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = RegexConstant.PHONE_REGEX, message = "手机号码输入有误")
    private String telephone;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = RegexConstant.PASSWORD_REGEX, message = "密码长度6-20位,不允许中文")
    private String password;
}
